package com.ostrich.cloud.ostrichUserWeb.app.ApiImp;

import com.ostrich.cloud.common.result.Result;
import com.ostrich.cloud.ostrichGoodsSercice.model.param.SnappedGoodParam;
import com.ostrich.cloud.ostrichGoodsService.client.SecKillClient;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class SecKillWebMangerApiImpl {

    @Resource
    private SecKillClient secKillClient;

  @PostMapping("snappedGood")
  public   Result snappedGood(@RequestBody SnappedGoodParam snappedGoodParam){
     return secKillClient.snappedGood(snappedGoodParam);

  }

    @GetMapping("getSecKill")
    @ApiOperation("获取秒杀商品")
     public   Result getSecKill(@RequestParam("status") String status){
      return secKillClient.getSecKill(status);
    }

    @GetMapping("getSecKillResult")
    @ApiOperation("获取秒杀结果")
    public Result getSecKillResult(@RequestParam("secId") Integer secId){
      return secKillClient.getSecKillResult(secId);
    }
}
